<template>
  <div class="app-container">
    <el-form  @submit.native.prevent :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!--      <el-form-item label="工程级档案表" prop="gid">-->
<!--        <el-input-->
<!--          v-model="queryParams.gid"-->
<!--          placeholder="请输入工程级档案表"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="案卷题名" prop="anJuanName">
        <el-input
          v-model="queryParams.anJuanName"
          placeholder="请输入案卷题名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="工程名" prop="gongChengName" v-if="showAdvanceSearch">
        <el-input
          v-model="queryParams.gongChengName"
          placeholder="请输入工程名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="档号" prop="dangNo" v-if="showAdvanceSearch">
        <el-input
          v-model="queryParams.dangNo"
          placeholder="请输入档号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="分类号" prop="fenLeiNo" v-if="showAdvanceSearch">
        <el-input
          v-model="queryParams.fenLeiNo"
          placeholder="请输入分类号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="案卷号" prop="anJuanNo" v-if="showAdvanceSearch">
        <el-input
          v-model="queryParams.anJuanNo"
          placeholder="请输入案卷号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总卷号" prop="zongJuanNo" v-if="showAdvanceSearch">
        <el-input
          v-model="queryParams.zongJuanNo"
          placeholder="请输入总卷号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
<!--      <el-form-item label="卷标" prop="juanNo">-->
<!--        <el-input-->
<!--          v-model="queryParams.juanNo"-->
<!--          placeholder="请输入卷标"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="地址" prop="secretLevel" v-if="showAdvanceSearch">
        <el-input
          v-model="queryParams.secretLevel"
          placeholder="请输入地址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
<!--      <el-form-item label="密级" prop="secretLevelName">-->
<!--        <el-select v-model="queryParams.secretLevelName" placeholder="请选择密级" clearable>-->
<!--          <el-option-->
<!--            v-for="dict in dict.type.security_dict"-->
<!--            :key="dict.value"-->
<!--            :label="dict.label"-->
<!--            :value="dict.value"-->
<!--          />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="${comment}" prop="storageLife">-->
<!--        <el-input-->
<!--          v-model="queryParams.storageLife"-->
<!--          placeholder="请输入${comment}"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="${comment}" prop="storageLifeName">-->
<!--        <el-input-->
<!--          v-model="queryParams.storageLifeName"-->
<!--          placeholder="请输入${comment}"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="兰图张数" prop="lanTuZhangShu">-->
<!--        <el-input-->
<!--          v-model="queryParams.lanTuZhangShu"-->
<!--          placeholder="请输入兰图张数"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="底图张数" prop="diTuZhangShu">-->
<!--        <el-input-->
<!--          v-model="queryParams.diTuZhangShu"-->
<!--          placeholder="请输入底图张数"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="文字材料张数" prop="wenZiCaiLiaoZhangShu">-->
<!--        <el-input-->
<!--          v-model="queryParams.wenZiCaiLiaoZhangShu"-->
<!--          placeholder="请输入文字材料张数"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="编制日期" prop="bianZhiDate" v-if="showAdvanceSearch">
        <el-date-picker clearable
                        v-model="queryParams.bianZhiDate"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择编制日期">
        </el-date-picker>
      </el-form-item>
<!--      <el-form-item label="形成单位" prop="xingChengDanWei">-->
<!--        <el-input-->
<!--          v-model="queryParams.xingChengDanWei"-->
<!--          placeholder="请输入形成单位"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="创建时间" prop="creationTime" v-if="showAdvanceSearch">
        <el-date-picker clearable
                        v-model="queryParams.creationTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
<!--      <el-form-item label="库号" prop="kuNum">-->
<!--        <el-input-->
<!--          v-model="queryParams.kuNum"-->
<!--          placeholder="请输入库号"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="列号" prop="leiNum">-->
<!--        <el-input-->
<!--          v-model="queryParams.leiNum"-->
<!--          placeholder="请输入列号"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="架号" prop="jiaNum">-->
<!--        <el-input-->
<!--          v-model="queryParams.jiaNum"-->
<!--          placeholder="请输入架号"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="层数" prop="cengShu">-->
<!--        <el-input-->
<!--          v-model="queryParams.cengShu"-->
<!--          placeholder="请输入层数"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="电子档案文件数" prop="wenJianShu">-->
<!--        <el-input-->
<!--          v-model="queryParams.wenJianShu"-->
<!--          placeholder="请输入电子档案文件数"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="归档时间" prop="yuLiuA">-->
<!--        <el-input-->
<!--          v-model="queryParams.yuLiuA"-->
<!--          placeholder="请输入归档时间"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="是否绑定案卷  " prop="yuLiuB">-->
<!--        <el-input-->
<!--          v-model="queryParams.yuLiuB"-->
<!--          placeholder="请输入是否绑定案卷  "-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="${comment}" prop="yuLiuC">-->
<!--        <el-input-->
<!--          v-model="queryParams.yuLiuC"-->
<!--          placeholder="请输入${comment}"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="${comment}" prop="yuLiuD">-->
<!--        <el-input-->
<!--          v-model="queryParams.yuLiuD"-->
<!--          placeholder="请输入${comment}"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button type="success" icon="el-icon-sort" size="mini" @click="toggleSearchMode">{{
          showAdvanceSearch ? '收起高级搜索' : '展开高级搜索'
        }}</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="primary"-->
<!--          plain-->
<!--          icon="el-icon-plus"-->
<!--          size="mini"-->
<!--          @click="handleAdd"-->
<!--          v-hasPermi="['system:anjuan:add']"-->
<!--        >新增</el-button>-->
<!--      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"

        >修改案卷信息</el-button>
<!--        v-hasPermi="['system:anjuan:edit']"-->
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"

        >删除案卷信息</el-button>
<!--        v-hasPermi="['system:anjuan:remove']"-->
      </el-col>
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="warning"-->
<!--          plain-->
<!--          icon="el-icon-download"-->
<!--          size="mini"-->
<!--          @click="handleExport"-->
<!--          v-hasPermi="['system:anjuan:export']"-->
<!--        >导出</el-button>-->
<!--      </el-col>-->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table ref="multipleTable" @row-click="handleRowClick" height="750" max-height="610" style="margin-top:10px" v-loading="loading" :data="anjuanList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="主键" align="center" prop="id" />-->
<!--      <el-table-column label="工程级档案表" align="center" prop="gid" />-->
      <el-table-column label="总卷号" align="center" prop="zongJuanNo" />
      <el-table-column label="档号" align="center" prop="dangNo" width="180"/>
      <el-table-column label="案卷题名" align="center" prop="anJuanName" width="350"/>
      <el-table-column label="工程名" align="center" prop="gongChengName" width="200"/>
      <el-table-column label="分类号" align="center" prop="fenLeiNo" width="60"/>
      <el-table-column label="案卷号" align="center" prop="anJuanNo" />
      <el-table-column label="归档时间" align="center" prop="yuLiuA" width="95"/>
      <el-table-column label="卷标" align="center" prop="juanNo" />
      <el-table-column label="密级" align="center" prop="secretLevelName">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.security_dict" :value="scope.row.secretLevelName"/>
        </template>
      </el-table-column>
      <el-table-column label="兰图张数" align="center" prop="lanTuZhangShu" />
      <el-table-column label="底图张数" align="center" prop="diTuZhangShu" />
      <el-table-column label="文字材料张数" align="center" prop="wenZiCaiLiaoZhangShu" width="100"/>
      <el-table-column label="地址" align="center" prop="secretLevel" width="220"/>
      <el-table-column label="编制日期" align="center" prop="bianZhiDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.bianZhiDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="creationTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.creationTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="库号" align="center" prop="kuNum" />
      <el-table-column label="列号" align="center" prop="leiNum" />
      <el-table-column label="架号" align="center" prop="jiaNum" />
      <el-table-column label="层数" align="center" prop="cengShu" />
      <el-table-column label="电子档案文件数" align="center" prop="wenJianShu" width="120"/>
<!--      <el-table-column label="${comment}" align="center" prop="storageLife" />-->
<!--      <el-table-column label="${comment}" align="center" prop="storageLifeName" />-->
<!--      <el-table-column label="形成单位" align="center" prop="xingChengDanWei" />-->
<!--      <el-table-column label="${comment}" align="center" prop="AnJuanStatus" />-->
<!--      <el-table-column label="是否绑定案卷  " align="center" prop="yuLiuB" />-->
<!--      <el-table-column label="${comment}" align="center" prop="yuLiuC" />-->
<!--      <el-table-column label="${comment}" align="center" prop="yuLiuD" />-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"

          >修改</el-button>
<!--          v-hasPermi="['system:anjuan:edit']"-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"

          >删除</el-button>
<!--          v-hasPermi="['system:anjuan:remove']"-->
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改查看案卷信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1700px" append-to-body>
      <el-form  @submit.native.prevent ref="form" :model="form" :rules="rules" label-width="100px">
        <el-row :gutter="20">
          <el-col :span="6">
            <!--            第一列-->
            <el-form-item label="总卷号" prop="zongJuanNo">
              <el-input v-model="form.zongJuanNo" placeholder="请输入总卷号" />
            </el-form-item>
            <el-form-item label="档号" prop="dangNo" >
              <el-input v-model="form.dangNo" placeholder="请输入档号，按规则生成 2014-F21-Y-0063 形成年度 + 分类号+保存年限+案卷号" />
            </el-form-item>
            <el-form-item label="案卷题名" prop="anJuanName">
              <el-input v-model="form.anJuanName" placeholder="请输入案卷题名" />
            </el-form-item>
            <el-form-item label="工程名" prop="gongChengName">
              <el-input v-model="form.gongChengName" placeholder="请输入工程名" />
            </el-form-item>
            <el-form-item label="分类号" prop="fenLeiNo">
              <el-input v-model="form.fenLeiNo" placeholder="请输入分类号" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <!--            第二列-->
            <el-form-item label="案卷号" prop="anJuanNo">
              <el-input v-model="form.anJuanNo" placeholder="请输入案卷号" />
            </el-form-item>
            <el-form-item label="归档时间" prop="yuLiuA">
              <el-input v-model="form.yuLiuA" placeholder="请输入归档时间" />
            </el-form-item>
            <el-form-item label="卷标" prop="juanNo">
              <el-input v-model="form.juanNo" placeholder="请输入卷标" />
            </el-form-item>
            <el-form-item label="密级" prop="secretLevelName">
              <el-select v-model="form.secretLevelName" placeholder="请选择密级">
                <el-option
                  v-for="dict in dict.type.security_dict"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="兰图张数" prop="lanTuZhangShu">
              <el-input v-model="form.lanTuZhangShu" placeholder="请输入兰图张数" />
            </el-form-item>
<!--            <el-form-item label="${comment}" prop="storageLife">-->
<!--              <el-input v-model="form.storageLife" placeholder="请输入${comment}" />-->
<!--            </el-form-item>-->
<!--            <el-form-item label="${comment}" prop="storageLifeName">-->
<!--              <el-input v-model="form.storageLifeName" placeholder="请输入${comment}" />-->
<!--            </el-form-item>-->
          </el-col>
          <el-col :span="6">
            <!--            第三列-->
            <el-form-item label="底图张数" prop="diTuZhangShu">
              <el-input v-model="form.diTuZhangShu" placeholder="请输入底图张数" />
            </el-form-item>
            <el-form-item label="文字材料张数" prop="wenZiCaiLiaoZhangShu">
              <el-input v-model="form.wenZiCaiLiaoZhangShu" placeholder="请输入文字材料张数" />
            </el-form-item>
            <el-form-item label="地址" prop="secretLevel">
              <el-input v-model="form.secretLevel" placeholder="请输入地址" />
            </el-form-item>
            <el-form-item label="编制日期" prop="bianZhiDate">
              <el-date-picker clearable
                              v-model="form.bianZhiDate"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择编制日期">
              </el-date-picker>
            </el-form-item>
<!--            <el-form-item label="形成单位" prop="xingChengDanWei">-->
<!--              <el-input v-model="form.xingChengDanWei" placeholder="请输入形成单位" />-->
<!--            </el-form-item>-->
            <el-form-item label="创建时间" prop="creationTime">
              <el-date-picker clearable
                              v-model="form.creationTime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择创建时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <!--            第四列-->
            <el-form-item label="库号" prop="kuNum">
              <el-input v-model="form.kuNum" placeholder="请输入库号" />
            </el-form-item>
            <el-form-item label="列号" prop="leiNum">
              <el-input v-model="form.leiNum" placeholder="请输入列号" />
            </el-form-item>
            <el-form-item label="架号" prop="jiaNum">
              <el-input v-model="form.jiaNum" placeholder="请输入架号" />
            </el-form-item>
            <el-form-item label="层数" prop="cengShu">
              <el-input v-model="form.cengShu" placeholder="请输入层数" />
            </el-form-item>
            <el-form-item label="电子档案文件数" prop="wenJianShu">
              <el-input v-model="form.wenJianShu" placeholder="请输入电子档案文件数" />
            </el-form-item>
<!--            <el-form-item label="是否绑定案卷  " prop="yuLiuB">-->
<!--              <el-input v-model="form.yuLiuB" placeholder="请输入是否绑定案卷  " />-->
<!--            </el-form-item>-->
<!--            <el-form-item label="${comment}" prop="yuLiuC">-->
<!--              <el-input v-model="form.yuLiuC" placeholder="请输入${comment}" />-->
<!--            </el-form-item>-->
<!--            <el-form-item label="${comment}" prop="yuLiuD">-->
<!--              <el-input v-model="form.yuLiuD" placeholder="请输入${comment}" />-->
<!--            </el-form-item>-->
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import { listAnjuan, getAnjuan, delAnjuan, addAnjuan, updateAnjuan } from "@/api/system/shiti_anjuan";

  export default {
    name: "Anjuan",
    dicts: ['security_dict'],
    data() {
      return {
        showAdvanceSearch: false,//初始时为简单搜索模式
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 查看案卷信息表格数据
        anjuanList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          gid: null,
          gongChengName: null,
          anJuanName: null,
          dangNo: null,
          fenLeiNo: null,
          anJuanNo: null,
          zongJuanNo: null,
          juanNo: null,
          secretLevel: null,
          secretLevelName: null,
          storageLife: null,
          storageLifeName: null,
          lanTuZhangShu: null,
          diTuZhangShu: null,
          wenZiCaiLiaoZhangShu: null,
          bianZhiDate: null,
          xingChengDanWei: null,
          creationTime: null,
          kuNum: null,
          leiNum: null,
          jiaNum: null,
          cengShu: null,
          wenJianShu: null,
          AnJuanStatus: null,
          yuLiuA: null,
          yuLiuB: null,
          yuLiuC: null,
          yuLiuD: null
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {
          gid: [
            { required: true, message: "工程级档案表不能为空", trigger: "blur" }
          ],
        }
      };
    },
    created() {
      this.getList();
    },
    methods: {
      // 高级搜索模式
      toggleSearchMode() {
        this.showAdvanceSearch = !this.showAdvanceSearch;
        setTimeout(() => {
          if (!this.showAdvanceSearch) {
            const searchForm = document.querySelector(".Search");
            if (searchForm) {
              searchForm.style.marginLeft = "";
            }
          }
        }, 0);
      },
      /** 查询查看案卷信息列表 */
      getList() {
        this.loading = true;
        listAnjuan(this.queryParams).then(response => {
          response.rows.map(row=>{row.dangNo=row.dangNo.substring(0, 11)+'0'+row.anJuanNo.toString()})
          this.anjuanList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          gid: null,
          gongChengName: null,
          anJuanName: null,
          dangNo: null,
          fenLeiNo: null,
          anJuanNo: null,
          zongJuanNo: null,
          juanNo: null,
          secretLevel: null,
          secretLevelName: null,
          storageLife: null,
          storageLifeName: null,
          lanTuZhangShu: null,
          diTuZhangShu: null,
          wenZiCaiLiaoZhangShu: null,
          bianZhiDate: null,
          xingChengDanWei: null,
          creationTime: null,
          kuNum: null,
          leiNum: null,
          jiaNum: null,
          cengShu: null,
          wenJianShu: null,
          AnJuanStatus: null,
          yuLiuA: null,
          yuLiuB: null,
          yuLiuC: null,
          yuLiuD: null
        };
        this.resetForm("form");
      },
      //点击行触发，选中或不选中复选框
      handleRowClick (row, column, event) {
        this.$refs.multipleTable.toggleRowSelection(row);
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length!==1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "添加查看案卷信息";
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        const id = row.id || this.ids
        console.log(id)
        getAnjuan(id).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "修改案卷信息";
        });
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.id != null) {
              updateAnjuan(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              });
            } else {
              addAnjuan(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              });
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids;
        this.$modal.confirm('是否确认删除查看案卷信息编号为"' + ids + '"的数据项？').then(function() {
          return delAnjuan(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {});
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('system/anjuan/export', {
          ...this.queryParams
        }, `anjuan_${new Date().getTime()}.xlsx`)
      }
    }
  };
</script>

<style>
  .el-form-item label {
    white-space: nowrap;
  }
</style>
